<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ko">
<head>
<title>기본 예제</title>
<meta name="class-lists" content="jindo.FileUploader"/>
<meta name="screenshots" content=""/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="description" content="jpg 파일을 선택하여 업로드후, html에 나타내는 예제입니다.">
<link rel="stylesheet" type="text/css" href="../asset/demo.css">
<style type="text/css">
	
</style>
</head>
<body>
<script type="text/javascript" src="../asset/demojs/demo.js#header"
     data-title="Jindo Component"
     data-subtitle="=document.title"
     data-backbutton="false"
     data-viewsource="false"
     data-qrcode="true"></script>
	
<div class="demo">
	<form method="POST" enctype="multipart/form-data">
    	<input type="file" id="file_select" name="Filedata">
		<div>
			<span id="info"></span>
		</div>
    </form>
</div>

<script type="text/javascript" charset="utf-8" src="../../asset/jindo.desktop.all.ns.js"></script>
<script type="text/javascript" charset="utf-8" src="../../source/jindo.Component.js"></script>
<script type="text/javascript" charset="utf-8" src="../../source/jindo.UIComponent.js"></script>
<script type="text/javascript" charset="utf-8" src="../../source/jindo.FileUploader.js"></script>
<script type="text/javascript">
	try { document.domain = "nhncorp.com"; } catch(e) {}
			
    var oFileUploader = new jindo.FileUploader(jindo.$("file_select"),{
        sUrl  : '../asset/server/FileUpload.php',
        sCallback : location.href.replace(/\/[^\/]*$/, '') + '/callback.html',
        sFiletype : '*.jpg', //*.jpg
        sMsgNotAllowedExt : 'jpg 확장자만 가능합니다',
		bAutoUpload : true,
		bAutoReset : false
    }).attach({
		select : function(oCustomEvent) {
			
		},
		
		success : function(oCustomEvent) {
			var wel = jindo.$Element("info");
			wel.html("size : " + oCustomEvent.htResult.size + " (bytes)<br>");
			wel.append(jindo.$("<img src='"+ oCustomEvent.htResult.url +"?ts=" + (new Date()).getTime() + "'>"));
		},
		
		error : function(oCustomEvent) {
			var wel = jindo.$Element("info");
			wel.html(oCustomEvent.htResult.errstr);
		}
	});
</script>
<script type="text/javascript" src="../asset/demojs/demo.js#footer"></script>
</body>
</html>
